package work;


import java.util.*;

public class Test {
    public static void main(String[] args) {
        Solution solution = new Solution();

        List<String> list = new ArrayList<>();
        list.add("leet");
        list.add("code");

        String[] words = new String[]{"bca","bcb","cda"};
        ListNode listNode = genListNodes(new int[]{1,2});

        TreeNode tree = TreeNode.createTree(new Integer[]{3, 9, 20, null, null, 15, 7});
        List<List<String>> equations = Arrays.asList(
                Arrays.asList("a", "b"),
                Arrays.asList("b", "c")
        );
        double[] values = new double[]{2.0,3.0};
        List<List<String>> queries = Arrays.asList(
                Arrays.asList("a", "c"),
                Arrays.asList("b", "a"),
                Arrays.asList("a", "e"),
                Arrays.asList("a", "a")
        );

        int[][] test = new int[][]{
                {1,1,-1},{1,1,1},{-1,1,1}
        };
        solution.maxSubarraySumCircular(new int[]{5,-3,5});
        System.out.println();
    }


    public static ListNode genListNodes(int[] nums){
        ListNode head = new ListNode();
        ListNode cur = head;
        for (int i = 0; i < nums.length; i++) {
            cur.next = new ListNode(nums[i]);
            cur = cur.next;
        }

        return head.next;
    }


    public static void trace(TreeNode treeNode){
        //层序遍历
        Queue<TreeNode> queue = new LinkedList<>();
        queue.offer(treeNode);
        while (!queue.isEmpty()){
            TreeNode root = queue.poll();
            System.out.println(root.val);
            if(root.left!=null)queue.offer(root.left);
            if(root.right!=null)queue.offer(root.right);
        }
    }
}